# MCPy C++ 库构建配置

# 包含目录
mcpy_inc = include_directories('../include')

# 源文件
mcpy_sources = files(
    'builtins/lambda.cpp',
    'builtins/list.cpp',
    'builtins/string.cpp',
    'builtins/global_functions.cpp',
    'builtins/async.cpp',
    'exception.cpp',
    'mcpy.cpp',
)

# 构建 mcpy 静态库
mcpy_lib = static_library(
    'mcpy',
    mcpy_sources,
    include_directories: mcpy_inc,
    dependencies: [libmcpp_dep],
    install: true,
    install_dir: get_option('libdir'),
)

mcpy_shared_lib = shared_library(
    'mcpy',
    include_directories: mcpy_inc,
    dependencies: [libmcpp_dep],
    install: true,
    install_dir: get_option('libdir'),
    link_whole: [
        mcpy_lib,
    ],
)

# 导出依赖
mcpy_dep = declare_dependency(
    link_with: [mcpy_shared_lib],
    include_directories: mcpy_inc,
    dependencies: [libmcpp_dep],
)